import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import 'element-plus/dist/index.css'
import {createStore} from "@/pinia"
import 'highlight.js/styles/atom-one-dark.css'
import 'highlight.js/lib/common'
import hljsVuePlugin from '@highlightjs/vue-plugin'
import 'highlight.js/styles/github.css'
import hljs from "highlight.js"
import json from "highlight.js/lib/languages/json"
import {ElButton} from './components/button'
import ElLoading from '@/components/loading/index'
import "@/assets/icon/iconfont.css"
import "@/assets/css/index"
import {formatDate} from '@vueuse/core'
import {setRequestInstance} from "@usehook/useRequest"
import request from "@/utils/request"
import directiveRegister from '@/directive'

hljs.registerLanguage("json", json)

setRequestInstance(request)

const app = createApp(App)
createStore(app)
app.use(router)
app.use(hljsVuePlugin)
app.use(ElButton)
app.use(ElLoading)
directiveRegister(app)

Date.prototype.format = function (fmt) {
    return formatDate(this, fmt)
}

app.mount('#app')
